pyswf · PyPI 您所在的位置:网站首页 python swf游戏 pyswf · PyPI

pyswf · PyPI

2024-04-03 15:05| 来源: 网络整理| 查看: 265

PYSWF=====A Python library for reading and writing SWF files.PYSWF is a Python port of Claus Wahlers *great* SWF parser https://github.com/claus/as3swfCan't thank Claus enough!

INSTALL-------

$ pip install pyswf==1.5.4

or:

$ git clone [email protected]:timknip/pyswf.git $ cd pyswf $ python setup.py install

or you might need do:

$ sudo python setup.py install

WINDOWS-------Install Pillow, lxml and pylzma from a binary distribution before running setup.- [Pillow 2.9.0](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow)- [lxml 3.4.0](https://pypi.python.org/pypi/lxml/3.4.0#downloads)- [pylzma 0.4.6](http://www.lfd.uci.edu/~gohlke/pythonlibs/#pylzma)

Installing the *.whl files:

$ pip install the-downloaded.whl

USAGE-----

Basic example:--------------```pythonfrom swf.movie import SWF

# create a file objectfile = open('path/to/swf', 'rb')

# print out the SWF file structureprint SWF(file)```

SVG export example:-------------------```pythonfrom swf.movie import SWFfrom swf.export import SVGExporter

# create a file objectfile = open('path/to/swf', 'rb')

# load and parse the SWFswf = SWF(file)

# create the SVG exportersvg_exporter = SVGExporter()

# export!svg = swf.export(svg_exporter)

# save the SVGopen('path/to/svg', 'wb').write(svg.read())```



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有